package com.tnt.springbootrabbitmq.consumer.fanoutExchange;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Description 消费者
 * @Author zhuangxl
 * @Date 2021-01-25 20:36
 */
@Slf4j
@Component
public class FanoutConsumer {

    /**
     * @Description: 第一个消费者
     * @Author: zhuangxl
     * @Date: 21/1/25 20:42
     * @param paramsMap:
     * @return: void
     **/
    @RabbitListener(queues = "fanoutQueue1")
    public void fanoutConsumer1(Map<String, Object> paramsMap){
        log.info("FanoutConsumer.fanoutConsumer1接收到队列消息：" + paramsMap);
    }

    /**
     * @Description: 第二个消费者
     * @Author: zhuangxl
     * @Date: 21/1/25 20:42
     * @param paramsMap:
     * @return: void
     **/
    @RabbitListener(queues = "fanoutQueue2")
    public void fanoutConsumer2(Map<String, Object> paramsMap){
        log.info("FanoutConsumer.fanoutConsumer2接收到队列消息：" + paramsMap);
    }
}
